﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildPlannerLib.Buildings
{
    // Derived class from Building for all buildings with no individual use
    public class NonProduction : Building
    {
        // Integer property for the count of this building type
        private int count;
        public int Count
        {
            get { return count; }
            set { count = value; }
        }

        // Constructor with parameters for name, cost, and time duration
        public NonProduction(string name, int mineralCost, int gasCost, int timeDuration)
        {
            Name = name;

            MineralCost = mineralCost;
            GasCost = gasCost;
            TimeDuration = timeDuration;
        }

        // Constructor with parameters for name, cost, time duration, and supply produced
        public NonProduction(string name, int mineralCost, int gasCost, int timeDuration, int supplyProduced)
        {
            Name = name;

            MineralCost = mineralCost;
            GasCost = gasCost;
            TimeDuration = timeDuration;

            SupplyProduced = supplyProduced;
        }

        // Constructor with parameters for name, cost, time duration, and requirement
        public NonProduction(string name, int mineralCost, int gasCost, int timeDuration, string requirement)
        {
            Name = name;

            MineralCost = mineralCost;
            GasCost = gasCost;
            TimeDuration = timeDuration;

            Requirement = requirement;
        }

        // Overrides GetCount() to return the value of the Count property
        public override int GetCount()
        {
            return Count;
        }

        // Overrides AddBuilding() to add 1 to the Count property
        public override void AddBuilding()
        {
            Count++;
        }

        // Overrides Reset() to set the Count property to 0
        public override void Reset()
        {
            Count = 0;
            Started = 0;
        }
    }
}
